package com.xm.zcf.dao.user;

import com.xm.zcf.action.Base.SessionBase;
import com.xm.zcf.domain.adminuser.Adminuser;
import com.xm.zcf.domain.user.User;
import com.xm.zcf.util.UUIDutils;
import org.springframework.stereotype.Repository;

/**
 * Created by Administrator on 2017/3/29.
 */
@Repository
public class UserDaoImpl extends SessionBase implements UserDao {
    @Override
    public void save(Adminuser model) {
        getSession().save(model);
    }

    @Override
    public Adminuser findByUser(String username, String password) {
        Adminuser adminuser=(Adminuser) getSession().createQuery("from Adminuser a where a.username=? and a.password=?")
                .setParameter(0,username)
                .setParameter(1,password)
                .uniqueResult();
        return adminuser;
    }
}
